Skip to content

Instantly share code, notes, and snippets.

View mongoltolbo's full-sized avatar

Lkhamsuren Amarjargal mongoltolbo

View GitHub Profile
@mongoltolbo
mongoltolbo / Change Text Selection and Highlight Color
Created December 24, 2013 03:18
Change Text Selection and Highlight Color
::selection {
background: #E599FF; /* Safari */
}
::-moz-selection {
background: #E599FF; /* Firefox */
}
@mongoltolbo
mongoltolbo / gist:7817988
Created December 6, 2013 03:13
Horizontally and vertically
.parent { position: relative; }
.child {
position: absolute;
left: 50%;
top: 50%
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
for i in *.svg; do inkscape -f "$i" -e "$i.png"; done
import fontforge
font = fontforge.open("/usr/share/fonts/truetype/ttf-malayalam-fonts/Meera_04.ttf", 4)
print "Glyphs"
for (i,g) in enumerate(font.glyphs()):
print "%s\t%s\t%s\t%s\t%s\t%s\t%s"%(i,g.glyphname,g.glyphclass,g.script,g.encoding,g.unicode,g.getPosSub("*"))
print "GSUB Lookups"
for (i,g) in enumerate(font.gsub_lookups):
print "%s\t%s"%(i,g)
print "GPOS Lookups"
for (i,g) in enumerate(font.gpos_lookups):
#!/usr/bin/python
import sys
import fontforge
if len(sys.argv) < 3:
print("Usage: %s <from> <to>" % sys.argv[0])
sys.exit(1)
fromfile = sys.argv[1]
import fontforge
font = fontforge.open("/usr/share/fonts/truetype/ttf-malayalam-fonts/Meera_04.ttf", 4)
print "Glyphs"
for (i,g) in enumerate(font.glyphs()):
print "%s\t%s\t%s\t%s\t%s\t%s\t%s"%(i,g.glyphname,g.glyphclass,g.script,g.encoding,g.unicode,g.getPosSub("*"))
print "GSUB Lookups"
for (i,g) in enumerate(font.gsub_lookups):
print "%s\t%s"%(i,g)
print "GPOS Lookups"
for (i,g) in enumerate(font.gpos_lookups):
@mongoltolbo
mongoltolbo / gist:5730663
Created June 7, 2013 16:50
Linux file permission
Earlier we discussed about how to use octal permission bits with chmod. In this article, let us review how to use symbolic representation with chmod.
Following are the symbolic representation of three different roles:
u is for user,
g is for group,
and o is for others.
Following are the symbolic representation of three different permissions:
r is for read permission,
var app = angular.module('gallery', ['ui.bootstrap']);
app.filter('startFrom', function() {
return function(input, start) {
if(input) {
start = +start; //parse to int
return input.slice(start);
}
return [];
}
/*** You don't need a -ms-prefix for IE10. [http://msdn.microsoft.com/en-us/library/ie/hh673530(v=vs.85).aspx] ***/
.my-animation {
-webkit-animation: my-animation 2s 0.5s 1 ease-in-out normal both;
-moz-animation: my-animation 2s 0.5s 1 ease-in-out normal both;
-o-animation: my-animation 2s 0.5s 1 ease-in-out normal both;
animation: my-animation 2s 0.5s 1 ease-in-out normal both;
}
/*** Single values in this case (prefix-free). ***/
@-webkit-keyframes NAME-YOUR-ANIMATION {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-moz-keyframes NAME-YOUR-ANIMATION {
0% { opacity: 0; }
100% { opacity: 1; }
}
@-ms-keyframes NAME-YOUR-ANIMATION {
0% { opacity: 0; }