Skip to content

Instantly share code, notes, and snippets.

@PurpleBooth
PurpleBooth / README-Template.md
Last active September 25, 2024 01:51
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@JacobHsu
JacobHsu / redis_list.js
Last active January 16, 2023 15:54
#nodejs redis list rpush lpush brpop blpop
var redis = require('redis'),
client = redis.createClient();
var arr = ["some val","some val2","some val3"];
//Use multi() to pipeline multiple commands at once
var multi = client.multi();
for (var i=0; i<arr.length; i++) {
//console.log(arr[i]);
//將一個或多個值value插入到列表key的表尾。
@visenger
visenger / install_scala_sbt.sh
Last active January 31, 2023 19:10
Scala and sbt installation on ubuntu 12.04
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update
@benshimmin
benshimmin / gist:4088493
Created November 16, 2012 16:03
Scale to fit and centre-align an image with FPDF
<?php
/* Caveat: I'm not a PHP programmer, so this may or may
* not be the most idiomatic code...
*
* FPDF is a free PHP library for creating PDFs:
* http://www.fpdf.org/
*/
require("fpdf.php");
class PDF extends FPDF {
@JamieMason
JamieMason / user.conf
Created August 3, 2012 07:40
Apache .conf to disable caching for localhost
<Directory "/Users/jdog/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Users/jdog/Sites/
@Artem-Mamchych
Artem-Mamchych / lxml example
Created January 18, 2012 22:36
Пример использования lxml
# coding: utf8
xml = '''<?xml version="1.0" encoding="UTF-8"?>
<soft>
<os>
<item name="linux" dist="ubuntu">
This text about linux
</item>
<item name="mac os">
Apple company
@aniav
aniav / flakes.py
Created September 12, 2011 13:45 — forked from mpasternacki/flakes.py
Django management command to run pyflakes against Django project
import ast
import os
from pyflakes import checker, messages
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
# BlackHole, PySyntaxError and checking based on
# https://github.com/patrys/gedit-pyflakes-plugin.git
@kogakure
kogakure / fabfile.py
Created October 17, 2009 14:20
Python: Fabric 0.9/1.x - Synchronize files with rsync
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Fabric 0.9/1.x – Synchronize files in a project folder with webserver
from fabric.api import env
from fabric.contrib.project import rsync_project
env.hosts = ['domain.com']
env.path = '/home/user/project/'