Skip to content

Instantly share code, notes, and snippets.

@zedshaw
zedshaw / safercopy_smash.c
Created January 4, 2015 19:07
Demonstration of using a pointer to alter the operation of another function in C.
View safercopy_smash.c
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#define MAXLINE 10 // in the book this is 1000
void safercopy(size_t to_length, char to[], size_t from_length, char from[])
{
int i = 0;
@staltz
staltz / introrx.md
Last active March 28, 2023 07:50
The introduction to Reactive Programming you've been missing
View introrx.md
@addyosmani
addyosmani / LICENSE.txt
Last active June 10, 2022 14:27 — forked from 140bytes/LICENSE.txt
Offline Text Editor in < 140 bytes (115 bytes). Powered by localStorage & contentEditable
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Copyright (C) 2014 ADDY OSMANI <addyosmani.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@Integralist
Integralist / GitHub curl.sh
Last active February 3, 2023 14:50 — forked from madrobby/gist:9476733
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
View GitHub curl.sh
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@callumacrae
callumacrae / build-tools.md
Last active March 20, 2023 14:24
Build tools written in JavaScript
View build-tools.md
@d3noob
d3noob / index.html
Last active July 30, 2018 10:41
Leaflet.FileLoader Plugin for Leaflet Maps
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Leaflet.FileLayer Plugin</title>
<meta charset="utf-8" />
<link
rel="stylesheet"
href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css"
/>
<link
@mikesmullin
mikesmullin / watch.sh
Last active January 25, 2023 15:51
watch is a linux bash script to monitor file modification recursively and execute bash commands as changes occur
View watch.sh
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <mike@smullindesign.com>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
@martinsik
martinsik / chat-frontend.js
Last active January 22, 2023 01:22
Node.js chat frontend and server
View chat-frontend.js
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@zippy1981
zippy1981 / DisplayImage.ps1
Created May 13, 2011 02:20
Display an image from Windows Powershell
View DisplayImage.ps1
# Loosely based on http://www.vistax64.com/powershell/202216-display-image-powershell.html
[void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms")
$file = (get-item 'C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg')
#$file = (get-item "c:\image.jpg")
$img = [System.Drawing.Image]::Fromfile($file);
# This tip from http://stackoverflow.com/questions/3358372/windows-forms-look-different-in-powershell-and-powershell-ise-why/3359274#3359274