Skip to content

Instantly share code, notes, and snippets.

@xXPhenomXx
xXPhenomXx / django_incrementing_tag.py
Created March 25, 2014 19:42
An incrementing Django template tag that can be used for things like Quantity inputs, etc...
class RangeNode(Node):
def __init__(self, num, context_name):
self.num, self.context_name = num, context_name
def render(self, context):
context[self.context_name] = range(int(self.num))
return ""
@register.tag
def num_range(parser, token):
"""
@xXPhenomXx
xXPhenomXx / base.jade
Created April 9, 2014 14:39
HTML5 boilerplate Jade
doctype html
html(class='no-js')
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
title
meta(name='description', content='')
meta(name='viewport', content='width=device-width, initial-scale=1')
//- Stylesheets

Before you post an issue on laravel/framework...

Run though this damn checklist... Please!

  1. Search existing issues
  2. Have I run rm bootstrap/compiled.php?
  3. Have I run git pull {laravel remote name} develop?
  4. Have I run rm -rf vendor?
  5. Have I run composer update --no-dev?
  6. Have I tried turning it off and on again :P?
#get root access
$su -
$ cd /tmp
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel
--- /usr/lib64/pypy-1.9/lib-python/2.7/distutils/unixccompiler.py 2012-06-15 11:33:20.000000000 -0700
+++ /tmp/unixccompiler.py 2013-06-17 12:39:10.212783192 -0700
@@ -297,7 +297,9 @@
# this time, there's no way to determine this information from
# the configuration data stored in the Python installation, so
# we use this hack.
- compiler = os.path.basename(sysconfig.get_config_var("CC"))
+ # XXX: http://bugs.python.org/issue14030
+ # compiler = os.path.basename(sysconfig.get_config_var("CC"))
+ compiler = os.path.basename(self.compiler[0])
@xXPhenomXx
xXPhenomXx / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@xXPhenomXx
xXPhenomXx / email_multi_related.py
Last active September 10, 2015 14:15
image email attachments using Django
@xXPhenomXx
xXPhenomXx / middleware.py
Created April 20, 2016 15:24 — forked from Miserlou/middleware.py
Django Profiler
# Orignal version taken from http://www.djangosnippets.org/snippets/186/
# Original author: udfalkso
# Modified by: Shwagroo Team and Gun.io
import sys
import os
import re
import hotshot, hotshot.stats
import tempfile
import StringIO
@xXPhenomXx
xXPhenomXx / cloudSettings
Last active September 8, 2017 14:12
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-09-08T14:12:44.873Z","extensionVersion":"v2.8.3"}
@xXPhenomXx
xXPhenomXx / time_format.go
Created February 18, 2018 21:45 — forked from ik5/time_format.go
A full example of all possible time formats in Golang
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("Times: ")
t := time.Now()