Skip to content

Instantly share code, notes, and snippets.

View nixon1333's full-sized avatar
Moving Fast

Ashraful Islam Nixon nixon1333

Moving Fast
View GitHub Profile
@nixon1333
nixon1333 / README.md
Created January 13, 2014 15:33 — forked from pilot/README.md

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/
.reset-this {
animation : none;
animation-delay : 0;
animation-direction : normal;
animation-duration : 0;
animation-fill-mode : none;
animation-iteration-count : 1;
animation-name : none;
animation-play-state : running;
animation-timing-function : ease;
@nixon1333
nixon1333 / IE dropdown arrow
Created May 17, 2014 08:08
Remove selectbox dropdown arrow in IE
.people-search::-ms-expand {
display: none;
}
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {

###HTTP status codes

  • 100 "continue"
  • 101 "switching protocols"
  • 102 "processing"
  • 200 "ok"
  • 201 "created"
  • 202 "accepted"
  • 203 "non-authoritative information"
  • 204 "no content"
var d = new Date();
var usertime = d.toLocaleString();
// Some browsers / OSs provide the timezone name in their local string:
var tzsregex = /\b(ACDT|ACST|ACT|ADT|AEDT|AEST|AFT|AKDT|AKST|AMST|AMT|ART|AST|AWDT|AWST|AZOST|AZT|BDT|BIOT|BIT|BOT|BRT|BST|BTT|CAT|CCT|CDT|CEDT|CEST|CET|CHADT|CHAST|CIST|CKT|CLST|CLT|COST|COT|CST|CT|CVT|CXT|CHST|DFT|EAST|EAT|ECT|EDT|EEDT|EEST|EET|EST|FJT|FKST|FKT|GALT|GET|GFT|GILT|GIT|GMT|GST|GYT|HADT|HAEC|HAST|HKT|HMT|HST|ICT|IDT|IRKT|IRST|IST|JST|KRAT|KST|LHST|LINT|MART|MAGT|MDT|MET|MEST|MIT|MSD|MSK|MST|MUT|MYT|NDT|NFT|NPT|NST|NT|NZDT|NZST|OMST|PDT|PETT|PHOT|PKT|PST|RET|SAMT|SAST|SBT|SCT|SGT|SLT|SST|TAHT|THA|UYST|UYT|VET|VLAT|WAT|WEDT|WEST|WET|WST|YAKT|YEKT)\b/gi;
// In other browsers the timezone needs to be estimated based on the offset:
var timezonenames = {"UTC+0":"GMT","UTC+1":"CET","UTC+2":"EET","UTC+3":"EEDT","UTC+3.5":"IRST","UTC+4":"MSD","UTC+4.5":"AFT","UTC+5":"PKT","UTC+5.5":"IST","UTC+6":"BST","UTC+6.5":"MST","UTC+7":"THA","UTC+8":"AWST","UTC+9":"AWDT","UTC+9.5":"ACST"
@nixon1333
nixon1333 / Live chat js Impmlementation
Created August 14, 2014 06:53
Implement live chat only using js code
<script type="text/javascript">
var __lc = {};
__lc.license = 4845221;
(function() {
var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
})();
</script>
var myDropzone = Dropzone.forElement("#nixon");
myDropzone.on("uploadprogress", function(file, message) { console.log(message); });
myDropzone.destroy();
var knox = require('knox');
var client = knox.createClient({
key: '<api key>'
, secret: '<s3 secrect>'
, bucket: 'tests'
});
var a = "https://s3.amazonaws.com/tests/53f1c7233f3712014-08-06-1024.png"
var image = a.substr(32);
client.del(String(image)).on('response', function(res){