Skip to content

Instantly share code, notes, and snippets.

//Test detectWixSite.js to make sure changes don't break it
const chai = require('chai'),
chaihttp = require('chai-http');
const should = chai.should();
const querystring = require('querystring')
const key = require('./secrets')
const motionAiEndpoint = 'https://api.motion.ai/1.0/messageBot'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://fb.me/react-with-addons-15.1.0.js"></script>
<script src="https://fb.me/react-dom-15.1.0.js"></script>
@barakplasma
barakplasma / post-commit
Created July 3, 2017 17:49
Githook via shell script to generate a screenshot of a static site after each commit
#!/bin/sh
cd ~/Pictures/Screenshots/Comigo
pageres ~/Documents/Projects/comigo/index.html --filename='<%= date %> - <%= time %> - <%= url %>'
<div class="triangle top"></div>
<div class="triangle base"></div>
<div class="line"></div>
<div class="pyramid left inline"></div>
<div class="pyramid right inline"></div>
@barakplasma
barakplasma / mario.c
Last active October 1, 2017 15:47
mario.c less created by barakplasma - https://repl.it/LtSy/8
#include "stdio.h"
//printer('x', 2) => xx
void printer(char toPrint, int timesToPrint){
for(timesToPrint;timesToPrint > 0;timesToPrint--){
printf(&toPrint);
}
}
void printSpace(int numSpaces){
@barakplasma
barakplasma / mario.c
Last active October 1, 2017 15:47
mario.c more version created by barakplasma - https://repl.it/LtSy/10
#include "stdio.h"
//printer('x', 2) => xx
void printer(char toPrint, int timesToPrint){
for(timesToPrint;timesToPrint > 0;timesToPrint--){
printf(&toPrint);
}
}
void printSpace(int numSpaces){
@barakplasma
barakplasma / bubbleSort.html
Last active December 1, 2017 20:06
Bubble sort in JS// source https://jsbin.com/viqotov
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Bubble sort in JS</title>
</head>
<body>
Bubble sort in JS
<script id="jsbin-javascript">
#include <stdio.h>
#include <stdlib.h>
// always copy the next line
int cmpfunc (const void * first, const void * second) {
// to get the value from the pointer, add the *(type*)name
return ( *(double*)first > *(double*)second );
// the above says: make first the second if first is greater than second
// in other words, swap if true/greater than zero (true = 1, false = 0)
};
#include <stdio.h>
#include <stdlib.h>
// always copy the next line
int cmpfunc (const void * first, const void * second) {
// to get the value from the pointer, add the *(type*)name
return ( *(double*)first > *(double*)second );
// the above says: make first the second if first is greater than second
// in other words, swap if true/greater than zero (true = 1, false = 0)
};
@barakplasma
barakplasma / SortingStringArraysWithQsort.c
Last active February 17, 2018 14:35
sorting strings with qsort created by barakplasma - https://repl.it/@barakplasma/sorting-strings-with-qsort
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// always copy the next line
int cmpStringfunc (const void * first, const void * second) {
// to get the value from the pointer, add the *(type*)name
return (strlen(*(const char **) first) < strlen(*(const char **) second));
// the above says: make first the second if first string length is less than second string length
// in other words, swap if true/greater than zero (true = 1, false = 0)