Skip to content

Instantly share code, notes, and snippets.

View syamsathyan's full-sized avatar

Syam Sathyan George syamsathyan

View GitHub Profile
@Andrew-Reid
Andrew-Reid / index.html
Last active November 4, 2017 23:10
Fun with d3 contours and force layouts
<!DOCTYPE html>
<meta charset="utf-8">
<style>
</style>
<canvas width="960" height="500"></canvas>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-contour.v1.min.js"></script>
<script>
@kiview
kiview / upgrade.yml
Last active November 3, 2023 12:52
Ubuntu upgrade with Ansible
---
- hosts:
- all
become: true
tasks:
- name: Update apt cache
apt: update_cache=yes
- name: Upgrade packages
apt: upgrade=dist
@ryane
ryane / five_minutes.yml
Created February 24, 2015 15:15
five_minutes.yml
---
- hosts: all
vars:
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx'
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx'
UBUNTU_COMMON_LOGWATCH_EMAIL: user@example.com
ubuntu_common_deploy_user_name: deploy
ubuntu_common_deploy_public_keys:
- ~/.ssh/id_rsa.pub
@lukevella
lukevella / elapsed.filter.js
Last active August 15, 2023 02:34
Elapsed Time AngularJS Filter
// {{ dateString | elapsed }}
angular.module('elapsedFilter', [])
.filter('elapsed', function(){
return function(date){
if (!date) return;
var time = Date.parse(date),
timeNow = new Date().getTime(),
difference = timeNow - time,
seconds = Math.floor(difference / 1000),
// Forked from: https://gist.github.com/melbourne2991/8822609
//
// Below is an example of a directive that let's other directives know when there has been a change
// in a breakpoint, as well as a windows resize, the event is triggered on the window resize and
// broadcast on $rootScope. The arguments contain the current & previous breakpoints. Previous will
// be null if there is yet to be a change in breakpoint.
//
app.directive('bsBreakpoint', function($window, $rootScope, $timeout) {
return {
controller: function() {
@pudo
pudo / threaded.py
Created June 23, 2013 14:39
Multi-threading in Python
from Queue import Queue
from threading import Thread
import logging
log = logging.getLogger(__name__)
def unthreaded(items, func):
""" Debug placeholder. """
for item in items:
func(item)
@leomelzer
leomelzer / Analyse.java
Created July 9, 2012 09:02
Simple-stupid Sentiment analysis for 1 million tweets.
package analyse;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@oodavid
oodavid / README.md
Last active June 12, 2024 00:28 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/