Skip to content

Instantly share code, notes, and snippets.

Daniel Lo Nigro Daniel15

Block or report user

Report or block Daniel15

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 1_Twitter autoresponder bot.md

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1

@Daniel15
Daniel15 / 1_README.md
Created Oct 3, 2011
ASP.NET Server Info page
View 1_README.md

Simple ASP.NET server info page. Shows uptime, hard drive space, and RAM.

Add this to Web.config system.web -> configuration -> assemblies:

@Daniel15
Daniel15 / GtkDimScreen.cs
Created Nov 21, 2011
Semi-transparent window in GTK# (Mono, C#)
View GtkDimScreen.cs
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Cairo;
using Gtk;
public class GtkDimScreen
{
private DrawingArea drawingArea;
View 1_readme.md
@Daniel15
Daniel15 / gist:1709107
Created Jan 31, 2012
Get content of currently executing page (ASP / VBScript)
View gist:1709107
Dim sPath
Dim oFS
Dim oTextStream
Dim sFile
sPath = Server.MapPath(Request.ServerVariables("SCRIPT_NAME"))
Set oFS = CreateObject("Scripting.FileSystemObject")
Set oTextStream = oFS.OpenTextFile(sPath, 1)
sFile = oTextStream.ReadAll()
Set oFS = Nothing
@Daniel15
Daniel15 / dabblet.css
Created Mar 6, 2012
Telstra buttons example
View dabblet.css
.telstra
{
border: 0;
padding: 0 0 0 30px;
margin: 0;
background: white url(http://i.imgur.com/N14wq.png) no-repeat;
height: 25px;
line-height: 25px;
cursor: pointer;
color: #003366;
View gist:2271700
root@lisa:/# /etc/init.d/php5-fpm restart
Restarting PHP5 FastCGI Process Manager: php5-fpm*** glibc detected *** /usr/sbin/php5-fpm: free(): invalid pointer: 0xb6d860f0 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x6e1da)[0xb6f621da]
/lib/i386-linux-gnu/libc.so.6(+0x6fa38)[0xb6f63a38]
/lib/i386-linux-gnu/libc.so.6(cfree+0x6d)[0xb6f66b3d]
/usr/sbin/php5-fpm(destroy_zend_class+0x228)[0x83192a8]
======= Memory map: ========
08048000-08710000 r-xp 00000000 08:01 11403530 /usr/sbin/php5-fpm
08710000-08771000 r-xp 006c7000 08:01 11403530 /usr/sbin/php5-fpm
@Daniel15
Daniel15 / gist:2549243
Created Apr 29, 2012
LESS mixin for RGBA colours in IE
View gist:2549243
// Use with colour name: .rgba(black, 0.5) or hex value: .rgba(#FF2400, 0.5)
.rgba(@colour, @alpha)
{
@alphaColour: hsla(hue(@colour), saturation(@colour), lightness(@colour), @alpha);
@ieAlphaColour: argb(@alphaColour);
background-color: @colour; // Fallback for older browsers
background-color: @alphaColour;
// IE hacks
@Daniel15
Daniel15 / gist:2826819
Created May 29, 2012
Internet Explorer's console.log is not actually a function.
View gist:2826819
>> document.getElementById
function getElementById() { [native code] }
>> document.getElementById instanceof Function
true
>> document.getElementById.apply
function apply() { [native code] }
>> typeof(document.getElementById)
"function"
>> console.log
function log() { [native code] }
@Daniel15
Daniel15 / gist:3074365
Created Jul 9, 2012
Validating JSONP callback function name in C#
View gist:3074365
/// <summary>
/// Validation of JSONP callback function names
/// </summary>
/// <remarks>
/// Based off the PHP code at https://gist.github.com/1217080, which is originally based off
/// a blog post at http://tav.espians.com/sanitising-jsonp-callback-identifiers-for-security.html
/// </remarks>
public class JsonValidator
{
/// <summary>
You can’t perform that action at this time.