This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
jack: 20, | |
amir: 22, | |
ali: 15, | |
}; | |
sortObject((persons) => { | |
var sortable = []; | |
for (var person in persons) { | |
sortable.push([person, persons[person]]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setInterval($func = null, $interval = 0, $times = 0){ | |
if( ($func == null) || (!function_exists($func)) ){ | |
throw new Exception('We need a valid function.'); | |
} | |
/* | |
usleep delays execution by the given number of microseconds. | |
JavaScript setInterval uses milliseconds. microsecond = one | |
millionth of a second. millisecond = 1/1000 of a second. | |
Multiplying $interval by 1000 to mimic JS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sample Functions.php: | |
if ( function_exists( 'add_theme_support' ) ) { | |
add_theme_support( 'post-thumbnails' ); | |
set_post_thumbnail_size( 150, 150, true ); // default Post Thumbnail dimensions (cropped) | |
// additional image sizes | |
// delete the next line if you do not need additional image sizes | |
add_image_size( 'category-thumb', 300, 9999 ); //300 pixels wide (and unlimited height) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $link = get_post_meta($post->ID, 'link', true); ?> | |
<?php echo $link; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<?php the_title( ); ?> | |
<?php the_content( ); ?> | |
<?php endwhile; ?> | |
<?php else: ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
root = Builder.load_string(’’’ | |
FloatLayout: | |
canvas.before: | |
Color: | |
rgba: 0, 1, 0, 1 | |
Rectangle: | |
# self here refers to the widget i.e FloatLayout | |
pos: self.pos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.interactive import InteractiveLauncher | |
from kivy.uix.widget import Widget | |
from kivy.uix.label import Label | |
from kivy.uix.scatter import Scatter | |
from kivy.graphics import Color, Rectangle ,Ellipse ,Bezier ,BorderImage | |
from kivy.animation import Animation as A | |
class myApp(App): | |
def build(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.interactive import InteractiveLauncher | |
from kivy.uix.widget import Widget | |
from kivy.uix.label import Label | |
from kivy.uix.scatter import Scatter | |
from kivy.graphics import Color, Rectangle ,Ellipse ,Bezier ,BorderImage | |
class myApp(App): | |
def build(self): | |
mywid = Widget() |
NewerOlder