Skip to content

Instantly share code, notes, and snippets.

View cstpraveen's full-sized avatar
💻
#Coding

Praveen Srinivasan cstpraveen

💻
#Coding
View GitHub Profile
@cstpraveen
cstpraveen / nginx.lang
Created February 3, 2020 06:29 — forked from wallneradam/nginx.lang
Nginx language specification file for GtkSourceView.
<?xml version="1.0" encoding="UTF-8"?>
<language id="nginx" _name="Nginx conf file" version="2.0" _section="Other">
<metadata>
<property name="mimetypes">text/x-nginx-conf-file;application/x-nginx-conf-file</property>
<property name="globs">*.conf</property>
<property name="line-comment-start">#</property>
</metadata>
<styles>
<style id="comment" _name="Comment" map-to="def:comment"/>
This is useful command suppose if u missed file now u want to track the commits where the file was modified
git log --follow -p -- file
If you do not know the exact path you may use
git log --all --full-history -- **/thefile.*
If you know the path the file was at, you can do this:
This is useful command suppose if u missed file now u want to track the commits where the file was modified
git log --follow -p -- file
in my case
git log --follow -p -- public/assets/images/photos/userprofile.png
@iest
iest / BzIframe.js
Created January 7, 2015 16:43
Basic react iframe with onLoad handler
'use strict';
var React = require('react');
var BzIframe = React.createClass({
propTypes: {
src: React.PropTypes.string.isRequired,
onLoad: React.PropTypes.func
},
@garystafford
garystafford / helpful-docker-commands.sh
Last active April 20, 2025 11:08
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container
@markogresak
markogresak / socket.io-emit-broadcast-usage.js
Created November 1, 2014 03:56
Different destination groups for socket.io emit and broadcast functions
// send to current request socket client
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.sockets.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@Y4suyuki
Y4suyuki / print_anim.py
Created October 3, 2013 06:22
python script which print animation on console
import time
import sys
animation = "|/-\\"
for i in range(100):
time.sleep(0.1)
sys.stdout.write("\r" + animation[i % len(animation)])
sys.stdout.flush()