Skip to content

Instantly share code, notes, and snippets.

class Light {
color col;
int state;
float x;
float y;
Light(color c) {
col = c;
}
void on() {
@indirectjump
indirectjump / traffic_light_oop.pde
Created September 4, 2017 05:31
Traffic Light Demo
class Light {
color col;
int state;
float x;
float y;
Light(color c) {
col = c;
}
void on() {
@lspdv
lspdv / quiz.js
Last active September 8, 2017 10:17
Given the following code, I understand what the output will be:
//Given the following code, I understand what the output will be
//Please answer fill only to the registration form for MSD Code Academy :-)
const obj = {
name: 'John',
getName () {
return this.name;
}
};
const name1 = obj.getName();
@roycewilliams
roycewilliams / mdxfind-is-awesome.txt
Last active April 18, 2026 01:08
mdxfind-is-awesome.txt
#
# The word 'password', hashed with many unsalted hash types, up to 5 iterations deep
# Courtesy MDXfind - https://www.techsolvency.com/pub/bin/mdxfind/
# Source: https://gist.github.com/roycewilliams/5e8d676ac4fe54fb7b6cb233b0721f57
#
# See also:
# https://github.com/roycewilliams/kens-salty-rainbow # Common default descrypt hashes
# https://gist.github.com/roycewilliams/794e4d7a81e7840deae29fdc7c03fa10 # 10k rounds MD5
# https://gist.github.com/roycewilliams/1c8044e40ed0716f99a773036a8891ac # 10k rounds SHA1
# https://gist.github.com/roycewilliams/56b17c9d8c6937725ee7e6331db79fda # 10K rounds SHA256
@williamhqs
williamhqs / GradientLine.swift
Last active December 12, 2019 22:08
CoreGraphics draw a line with gradient and lineCap
class GradientLineView: UIView {
override func draw(_ rect: CGRect) {
if let context = UIGraphicsGetCurrentContext() {
let startPoint1 = CGPoint(x: 20, y: rect.height/2)
let endPoint1 = CGPoint(x: rect.width-120, y: rect.height/2)
context.setLineWidth(15)
context.move(to: startPoint1)
context.addLine(to: endPoint1)
context.setLineCap(.round)
@itn3000
itn3000 / ByteComparer.cs
Last active August 29, 2017 09:10
byte array comparer(inspired by Messagepack-CSharp and System.Span<T>)
using System;
static class ByteComparer
{
public static bool AreSameSpan(byte[] b1, byte[] b2)
{
var span = new Span<byte>(b1);
var span2 = new Span<byte>(b2);
return span.SequenceEqual(span2);
}
@iiiBird
iiiBird / slide_count.js
Created August 29, 2017 05:27
slick slide count and all slides
$('.gallery-slider-thumb').on('init', function(event, slick, currentSlide, nextSlide){
var currentSlide = slick.currentSlide + 1;
var slideCount = slick.slideCount;
$(this).parents('.gallery-slider-thumb-wr').find('.gs-count__current').text(currentSlide);
$(this).parents('.gallery-slider-thumb-wr').find('.gs-count__all').text(slideCount);
});
$('.gallery-slider-thumb').on('afterChange', function(event, slick, currentSlide, nextSlide){
var currentSlide = slick.currentSlide + 1;
$(this).parents('.gallery-slider-thumb-wr').find('.gs-count__current').text(currentSlide);
@davo
davo / gist:5bae0e49affc117765c796f9c6b8eace
Created August 29, 2017 05:23 — forked from flipjs/gist:f3afa204a7530679eaf4
CoffeeScript Style Guide (using no prototype)
### flipjs.io CoffeeScript Style Guide ###
do ->
############################################################ CLASS ###
class Animal
constructor: (@name) ->
initProps = =>
@mortymacs
mortymacs / install-erlang-manually.md
Created August 29, 2017 05:22
Install Erlang From Source code Wothout wx and doc

Requirements

$ apt-get install libncurses5-dev

Manually

$ wget -c http://erlang.org/download/otp_src_19.3.tar.gz
$ tar xzf otp_src_19.3.tar.gz
$ cd otp_src_19.3/